module executor.initialization.server.InitExecutor;

import msgtrans;
import message.Constants;
import message.MsgDefine;
import google.protobuf;
import hunt.logging;
import std.array;
import hunt.util.Serialize;
import client.MsgServerClient;
import cache.ChatIdMap;
import client.GateServerClient;
import cache.UserStatusManager;

@TransportServer(MsgServerName)
class InitExecutor : AbstractExecutor!(InitExecutor) {

  @MessageId(MESSAGE.CMD_REGISTER_GATESERVER)
  void getGateServerConnection(TransportContext ctx, MessageBuffer buffer) {
    //TransportSession[ulong] clients = GateServerClient.getInstance.getAllClient();
    //if (ctx.id in clients)
    //{
    //  logWarning("gateclient %d is exist" , ctx.id);
    //}else
    //{
      logInfof("CMD_REGISTER_GATESERVER %d", ctx.id);
      GateServerClient.getInstance.addForwardClient(ctx,ctx.id);
    //}
  }

  @MessageId(MESSAGE.CMD_REGISTER_MSGSERVER)
  void getMsgServerConnection(TransportContext ctx, MessageBuffer buffer) {

  }
}

